Message delivery in a message system

ABSTRACT

Control of message delivery from publisher devices to a subscriber application of a messaging system is provided. The subscriber application has a subscription registered with a broker application of the messaging system and is only permitted to receive messages relating to a topic of the subscription from a predetermined set of one or more publisher devices. The method includes: altering a topic identifier of a message from a publisher device to a modified topic identifier, and altering a subscription identifier from a subscriber application to a modified subscription identifier; analyzing the modified topic identifier and the modified subscription identifier to determine if the message is to be communicated to the subscriber application, and if so, information is removed from the modified topic identifier to form a reverted topic identifier, and the message and reverted topic identifier are communicated to the subscriber application.

BACKGROUND

The present invention relates to the field of message delivery in amessage system, and more specifically, to controlling message deliveryfrom publisher devices to a subscriber application.

Publish/subscribe is a messaging mechanism by which subscriberapplications (hereinafter referred to as “subscribers”) may receiveinformation, in the form of messages, from publisher devices(hereinafter referred to as “publishers”). In this context, a message isa unit of data (such as one or more bits or a string of data). A typicalpublish/subscribe system has more than one publisher and more than onesubscriber.

SUMMARY

According to one or more aspects, a computer-implemented method isprovided for controlling message delivery from publisher devices to asubscriber application of a messaging system, the subscriber applicationhaving a subscription registered with a broker application of themessaging system and only being permitted to receive messages relatingto a topic of the subscription from a predetermined set of one or morepublisher devices. The method includes: altering a topic identifier of amessage from a publisher device to a modified topic identifiercomprising a description of the topic of the message, and a set of oneor more publisher devices that the publisher device belongs to; alteringa subscription identifier from a subscriber application to a modifiedsubscription identifier comprising a description of the topic of thesubscription, and a predetermined set of one or more publisher devicesthat a message is permitted to be received from; analyzing the modifiedtopic identifier and the modified subscription identifier to determineif the message is to be communicated to the subscriber application, andif the message is to be communicated to the subscriber application,removing the description of the set of one or more publisher devicesthat the publisher device belongs to from the modified topic identifierto form a reverted topic identifier, communicating the message andreverted topic identifier to the subscriber application.

According to one or more other aspects, a computer program product isprovided for controlling message delivery from publisher devices to asubscriber application of a messaging system, the subscriber applicationhaving a subscription registered with a broker application of themessaging system and only being permitted to receive messages relatingto a topic of the subscription from a predetermined set of one or morepublisher devices, wherein the computer program product comprises acomputer readable storage medium having program instructions embodiedtherewith, the program instructions being executable by a processingunit to cause the processing unit to perform a method comprising:altering a subscription identifier from a subscriber application to amodified subscription identifier comprising a description of the topicof the subscription, and a predetermined set of one or more publisherdevices that a message is permitted to be received from; analyzing themodified topic identifier and the modified subscription identifier todetermining if the message is to be communicated to the subscriberapplication; and where the message is to be communicated to thesubscriber application, removing the description of the set of one ormore publisher devices that the publisher device belongs to from themodified topic identifier to form a reverted topic identifier, andcommunicating the message and reverted topic identifier to thesubscriber application.

In one or more further aspects, a system is provided for controllingmessage delivery from publisher devices to a subscriber application of amessaging system, the subscriber application having a subscriptionregistered with a broker application of the messaging system and onlybeing permitted to receive messages relating to a topic of thesubscription from a predetermined set of one or more publisher devices.The system includes a memory, and a processor communicatively coupled tothe memory, wherein the system performs a method comprising: altering asubscription identifier from a subscriber application to a modifiedsubscription identifier comprising a description of the topic of thedescription, and a predetermined set of one or more publisher devicesthat a message is permitted to be received from; analyzing the modifiedtopic identifier and the modified subscription identifier to determineif the message is to be communicated to the subscriber application, andif the message is to be communicated to the subscriber application,removing the description of the set of one or more publisher devicesthat the publisher device bellows to from the modified topic identifierto form a reverted topic identifier, communicating the message andreverted topic identifier to the subscriber application.

BRIEF DESCRIPTION OF THE DRAWINGS

Several embodiments of the present invention are described below, by wayof example only, with reference to the drawings, in which:

FIG. 1 is a block diagram of an example embodiment of a messaging systemaccording to an embodiment wherein the example of a first publisherdevice of a first set of devices publishing a message is illustrated, inaccordance with one or more aspects of the present invention;

FIG. 2 illustrates a modification to the embodiment of FIG. 1, whereinthe example of a second publisher device of a second set of devicespublishing a message is illustrated, in accordance with one or moreaspects of the present invention;

FIG. 3 is a flow chart of a method, in accordance with one or moreaspects of the present invention; and

FIG. 4 is a schematic block diagram of a system, in accordance with oneor more aspects of the present invention.

DETAILED DESCRIPTION

It should be understood that the figures are merely schematic and arenot drawn to scale. It should also be understood that the same referencenumerals used throughout different figures designate the same or similarparts.

Interactions between publishers and subscribers may be controlled bycomponents of a general purpose messaging system, such as a queuemanager or by a component known as a message broker (or brokerapplication). A messaging system is a service to which applications mayconnect, and a queue is an ordered list of messages maintained by themessaging system. Applications may place a message on a queue or requesta message from a queue. The distinction between a queue manager and amessage broker/broker application is not relevant to the present subjectmatter and these terms may be used interchangeably within the followingdescription.

Publishers (such as publisher devices) supply information about asubject, without needing to know anything about the applications thatare interested in that information. Publishers generate this informationin the form of messages, called publications, that they want to publish,and define the topic of these messages. Typically, the controllingcomponent (e.g. broker application) receives messages from publishersand subscriptions identifying subscribers on one or more topics. It thenroutes the published messages to the subscribers that have a registeredinterest in the topic(s).

Subscribers create subscriptions that describe the topic that thesubscriber is interested in. Thus, the subscription determines whichpublications are forwarded to the subscriber. Subscribers may makemultiple subscriptions and may receive information from many differentpublishers.

For example, Message Queuing Telemetry Transport (MQTT) is a knownmessage publish/subscribe system. MQTT employs topic strings to separatethe space of messages (rather like directories and subdirectories inhierarchical file systems). Messages are published to topics, andsubscribers subscribe to topics so they only receive messages they areinterested in. By way of example, a message published to a topic stringof: “mytopic1/sect1/part1/type3/data” would match a subscribe to:“mytopic1/sect1/part1/type3/data”

MQTT employs the concept of wild cards in topic strings forsubscriptions, with “+” matching one level and a trailing “#” matchingany number of levels below. Wild card # matches any number of topiclevels, so the following subscriptions would match to the publishedtopic string above (of: “mytopic1/sect1/part1/type3/data”):

“mytopic1/sect1/part1/type3/#”

“mytopic1/sect1/part1/#”

“mytopic1/sect1/#”

“mytopic1/#”

“mytopic1/+/part1/type3/data”

“mytopic1/sect1/+/type3/data”

“mytopic1/sect1/+/+/data”

“mytopic1/+/part1/+/data”.

Conversely, the subscription “mytopic1/sect1/+/type2/data” would notmatch to the published topic string above (of:“mytopic1/sect1/part1/type3/data”).

A drawback is that publication of a message may be a costly operationfor the publisher and/or the broker. For example, if the publisher is alow-powered sensor which requires the use of a radio to publish amessage, publication of a message will consume much-needed batterypower. Also, if a message to be published is very large, a large amountof resources may be required to publish the message.

It is therefore desirable for a publisher to avoid unnecessarypublication of messages, such as when there are no subscribers for thetopic of the message for example. One possible approach to address thisis for the publisher to transmit information about the message topic tothe broker and ask whether there are any subscriptions matching thetopic. However, this approach requires a request/response conversationbetween the publisher and broker. Also, if the publisher is publishingmessages about many different topics, many conversations may berequired.

Further, subscriber applications may only be authorized to receivepublished messages from certain publisher devices. For example, sincepublisher devices can be grouped into ‘bunches’ or ‘sets’, and asubscriber application can be authorized to subscribe to a particularset of publisher devices, the subscriber application will then onlyreceive data from devices in that set of publisher devices. Publisherdevices may however be members of (e.g. belong to, or be included in)more than one set. Republishing each message to every set a device is amember of is therefore sub-optimal in terms of resource usage orefficiency. Also, another approach may be to have multiplesubscriptions, one for each device in a set. This, however, exhibits asimilar problem in that each subscription by a subscriber application isthen converted to multiple subscriptions, one for each device. Thebroker application then needs to handle all the different subscriptionsand match each device message with a subscription, which is againsub-optimal in terms of resource usage or efficiency.

Detailed herein is a concept for enabling flexible subscriptions suchthat different subscriber applications can use different topic stringsto subscribe to the messages from sets of devices. The concept may beemployed in a messaging system comprising sets of publisher devices, abroker (e.g. broker application) and a subscriber application. It may besuch that the subscriber application is only permitted to receivemessages relating to a topic of the subscription from a predeterminedset of publisher devices.

As disclosed herein, modified topic identifiers and modified subscriberidentifiers may be generated, which may then be used (e.g. processed oranalysed by a broker application) to control the delivery of publishedmessages to the subscriber application(s). Prior to delivery to asubscriber application, the modified topic identifier may be revertedback to its original form. In this way, new capabilities may be added toexisting messaging systems.

For instance, an embodiment may not involve changing a MQTT broker, butinstead a proxy application may be inserted between (i) the broker and(ii) the publisher devices and subscriber applications. Such a proxyapplication may, for example, intercept messages from a publisher deviceand undertake modification of the topic identifiers before communicatingthe modified topic identifiers to the broker. Similarly, the proxyapplication may intercept subscriptions from a subscriber applicationand undertake modification of the subscription identifiers beforecommunicating the modified subscription identifiers to the broker. Theproxy application may also then intercept messages from the broker andrevert the modified topic identifiers back to their original form beforecommunicating the message to the intended/target subscriber application.

One or more embodiments may therefore employ MQTT matching and wildcardsto efficiently subscribe to messages from different sets of devices andperform message authorization and filtering. Also, an existing MQTTbroker, like Really Small Message Broker (RSMB), may inject and removetopic prefixes, but only for separate end points. The publisher candetermine if there is any need to publish the message and thereby avoidpublishing messages for which there is no subscription.

Referring to FIGS. 1 and 2, a messaging system is depicted according toa proposed embodiment of the present invention. The messaging system 5comprises a first set 11 of publisher devices 10, a second set 13 ofpublisher devices 12, a message broker 14, first 16 and second 18subscriber applications, and a proxy 20. Interactions such ascommunication of messages from the publisher device 10, 12 to thesubscriber applications 16, 18 are controlled by the message broker 14,but are routed via (for example, through) the proxy 20.

The messaging system 5 is a service to which applications may connectand a queue is an ordered list of messages maintained by the messagingsystem 5. Applications may place a message on a queue or request amessage from a queue. The distinction between a queue manager and amessage broker is not relevant to the present subject matter and theseterms may be used interchangeably within the following description.

Each publisher device 10,12 is adapted to supply information about asubject, without needing to know anything about the applications thatare interested in that information. The publisher devices 10, 12generate the information in the form of messages, or publications, anddefine the topic(s) of these messages in a topic identifier. The messagebroker 14 is adapted to receive messages from the publisher devices 10,12 via the proxy 20, in addition to subscriptions from subscribers ofone or more topics. The message broker 14 is adapted to route publishedmessages to subscribers that have a registered interest in the topic(s)of the published messages.

The subscriber applications 16, 18 create subscriptions that describethe topic(s) that the subscriber is interested in. Thus, a subscriptiondetermines which publications are of interest to a subscriberapplication. The subscriber applications 16, 18 may make multiplesubscriptions and may receive information from different publisherdevices.

To receive publications, a subscriber application 16, 18 creates asubscription to selected publication topics. The subscriber applications16, 18 generate the subscription information and define the topic of thesubscription using a subscription identifier. The message broker 14 isadapted to receive subscription identifier from the subscriberapplications 16, 18 via the proxy 20.

However, in this example, each subscriber application is only permitted(for example, authorized) to receive publications relating to a topic ofthe subscription from a predetermined set of publisher devices. Forexample, in the embodiment of the FIGS. 1-2, the first subscriberapplication 16 may only be authorized to receive publications from thefirst set 11 of publisher devices, and the second subscriber application18 may only be authorized to receive publications from the second set 13of publisher devices.

The message broker 14 is adapted to deliver publications to subscribersthat have subscriptions which match the publication topic and authorizedto receive the publications.

Thus, it will be appreciated that the proxy 20 of FIGS. 1-2 is insertedbetween (i) the broker 14 and (ii) the sets 11,13 of publisher devicesand subscriber applications 16,18. The proxy 20 is adapted to interceptmessages from the publisher devices and alter the topic identifiers ofthe messages before communicating the messages (along with theirmodified topic identifiers) to the broker 14. The proxy 20 is alsoadapted to intercept subscriptions from the subscriber applications 16,18 and alter the subscription identifiers before communicating thesubscriptions (and their modified subscription identifiers) to thebroker 14. Also, the proxy 20 is adapted to intercept outgoing messagesfrom the broker 14 and alter the modified topic identifiers back totheir original form (for instance, remove the information that the proxypreviously added into a topic identifier) before communicating themessage, along with its reverted topic identifier, to theintended/target subscriber application.

A topic can be implemented as a text string describing an area ofinterest on which applications may wish to exchange messages (e.g.,“topic1”). Subjects may be organized hierarchically, such as into atopic tree, using the forward slash (“/”) character to create subtopicsin the topic string (e.g., “topic1/myt1”). Topics are nodes in the topictree that is the total space of all topics used within the messaginginfrastructure. Topics may be leaf-nodes with no further subtopics, orintermediate nodes with subtopics. Topic strings that are created torepresent subscriptions may contain wildcard schemes to pattern matchagainst the topics of publications.

A subscription may be represented by a regular expression such as textstring for example. Thus, more generally, a representation of asubscription may be represented using regular grammar. In the field ofcomputer science, a regular grammar is a formal grammar that describes aregular language. Also, as has already been mentioned above in thedescription, a subscription description may employ wild cards in topicstrings. For example, the character “+” may be used to matching onelevel, and the trailing character “#” may be used to match any number oflevels below.

Subscriptions may be, by way of example, of two types: durable andnon-durable. Non-durable subscriptions exist only as long as thesubscribing application's connection to the broker 14 remains active.The subscription is removed when the subscribing application disconnectsfrom the broker 14 deliberately or by loss of connection. Durablesubscriptions continue to exist when a subscribing application'sconnection to the broker 14 is closed. If a subscription is durable,then when the subscribing application disconnects, the subscriptionremains in place and may be used by the subscribing application when itreconnects.

Thus, the messaging system 5 employs a selective publication concept,wherein the system is adapted to determine whether or not to communicatea publication (e.g. message) to a subscriber application. The messagingsystem 5 may, in some embodiments, push (that is, communicate withoutrequest) publications in response to registration of a new subscriberapplication for a specified topic. The system 5 may also push (that is,communicate without request) communications to the publisher devices inresponse to registration of a new subscriber application for a specifiedtopic.

A subscriber application 16, 18 that is already connected to the system5 may register a new subscription for a topic in which it is interestedwith the broker 14. Subscriber applications 16, 18 may do this on adurable basis (once registered, the subscription remains untilexplicitly deleted) or a non-durable basis (when the applicationdisconnects, the subscription is removed).

Referring to FIG. 1 in particular, a first publisher device 10 may be amember of the first set 11 (or “SET1”) of publisher devices, and asecond publisher device 12 may be a member of the second set 13 (or“SET2) of the publisher devices.

First subscriber application 16 (or “APP1”) is authorized to receive allmessages from the first set 11 (i.e. SET1). In this example, itsubscribes to all messages relating to “TOPIC1” using the subscriptionidentifier “TOPIC1/+”

The proxy 20 receives (for example, intercepts) the subscriptionidentifier from the first subscriber application 16 (that is, APP1) andalters the subscription identifier to create a modified subscriptionidentifier comprising a description of: the topic of the subscription(for instance, “TOPIC1/+”); and the set (i.e., SET1) of publisherdevices that the first subscriber application 16 is permitted to receivepublications/messages from (e.g. “C1/SET1/”). As a result, thesubscription identifier is modified from the original subscriptionidentifier “TOPIC1/+” to create modified subscription identifier“C1/SET1/TOPIC1/+”.

The proxy 20 then communicates the modified subscription identifier“C1/SET1/TOPIC1/+” to the broker 14.

Second subscriber application 18 (or “APP2”) is authorized to receiveall messages from the second set 13 (i.e. SET2). In this example, italso subscribes to all messages on relating to “TOPIC1” using thesubscription identifier “TOPIC1/+”

The proxy 20 receives (e.g. intercepts) the subscription identifier fromthe second subscriber application 18 (i.e. APP2) and alters thesubscription identifier to create a modified subscription identifiercomprising a description of the topic of the subscription (e.g.“TOPIC1/+”), and the set (i.e. SET2) of publisher devices that thesecond subscriber application 18 is permitted to receivepublications/messages from (e.g. “C1/SET2/”). As a result, thesubscription identifier is modified from the original subscriptionidentifier “TOPIC1/+” to create modified subscription identifier“C1/SET2/TOPIC1/+”.

The proxy 20 then communicates the modified subscription identifier“C1/SET2/TOPIC1/+” to the broker 14.

Subsequently, the first publisher device 10 publishes a message relatingto “MYT1” which is sub-topic of “TOPIC1”. Thus, in this example, thefirst publisher device 10 publishes a message with the topic identifier“TOPIC1/MYT1”.

The proxy 20 receives (e.g. intercepts) the topic identifier from thefirst publisher device 10 and alters the topic identifier to create amodified topic identifier comprising a description of: the topic of themessage (e.g. “TOPIC1/MYT1”); and the set (i.e. SET1) of publisherdevices that the first publisher device 10 belongs to (e.g. “C1/SET1/”).As a result, the topic identifier is modified from the original topicidentifier “TOPIC1/MYT1” to create modified topic identifier“C1/SET1/TOPIC1/MYT1”.

The proxy 20 then communicates the modified topic identifier“C1/SET1/TOPIC1/MYT1” to the broker 14.

The broker 14 analyzes the modified topic identifier against themodified subscription identifiers it has received from the first 16 andsecond 18 subscriber applications (via the proxy 20) to determine if thepublished message is to be communicated to a subscriber application.

Here, in this example, the broker 14 matches the modified topicidentifier “C1/SET1/TOPIC1/MYT1” to the modified subscription identifier“C1/SET1/TOPIC1/+” from the first subscriber application 16. Thus, thebroker 14 determines that the message from the first publisher device 10is to be communicated to the first subscriber application 16.

Accordingly, the broker 14 sends the message with the modified topicidentifier “C1/SET1/TOPIC1/MYT1” to the first subscriber application 16via the proxy 20.

The proxy 20 removes the description (i.e. “C1/SET1/”) of the set ofdevices that the publisher device belongs to from the modified topicidentifier, thereby forming a reverted topic identifier (which isidentical to the original topic identifier “TOPIC1/MYT1” of the messagepublished by the first publisher device 10).

The proxy 20 then communicates the published message with the revertedtopic identifier to the first subscriber application 16.

By way of further example, and referring to FIG. 2, an example of thesecond publisher device subsequently publishing a message is describedbelow. Here, the second publisher device 12 publishes a message relatingto “MYT2”, which is sub-topic of “TOPIC1” (but different from thesub-topic “MYT1”). Thus, in this example, the second publisher device 12publishes a message with the topic identifier “TOPIC1/MYT2”.

The proxy 20 receives (e.g. intercepts) the topic identifier from thesecond publisher device 12 and alters the topic identifier to create amodified topic identifier comprising a description of the topic of themessage (e.g. “TOPIC1/MYT2”), and the set (i.e. SET2) of publisherdevices that the second publisher device 12 belongs to (e.g.“C1/SET2/”). As a result, the topic identifier is modified from theoriginal topic identifier “TOPIC1/MYT2” to create modified topicidentifier “C1/SET2/TOPIC1/MYT2”.

The proxy 20 then communicates the modified topic identifier“C1/SET2/TOPIC1/MYT2” to the broker 14.

The proxy 20 analyzes the modified topic identifier against the modifiedsubscription identifiers it has received from the first 16 and second 18subscriber applications to determine if the published message is to becommunicated to a subscriber application.

Thus, in this example, the broker 14 matches the modified topicidentifier “C1/SET2/TOPIC1/MYT2” to the modified subscription identifier“C1/SET2/TOPIC1/+” from the second subscriber application 18. The broker14 therefore determines that the message from the second publisherdevice 12 is to be communicated to the second subscriber application 18.

Accordingly, the broker 14 sends the message with the modified topicidentifier “C1/SET2/TOPIC1/MYT2” to the second subscriber application 18via the proxy 20.

The proxy 20 removes the description (i.e. “C1/SET2/”) of the set ofdevices that the publisher device belongs to from the modified topicidentifier, thereby forming a reverted topic identifier (which isidentical to the original topic identifier “TOPIC1/MYT2” of the messagepublished by the second publisher device 12).

The proxy 20 then communicates the published message with the revertedtopic identifier to the second subscriber application 18.

In view of the above-described examples of FIGS. 1-2, one may nowconsider an example wherein messages are published by cars of differenttypes. In such an example, an administrator may have decided the groupthe cars into the follow twelve sets: Model1; Model2; diesel; petrol;GB; France; Germany; USA; Canada; Europe; North America; andsatellite_radio. Subscriber application may then be authorized toreceive published messages from just any one of these twelve sets.

By inspection, there are the following exclusive groups:

Model: Model1; Model2;

Engine: diesel; petrol (gasoline);

Country: GB; France; Germany; USA; Canada;

Continent: Europe; NorthAmerica;

Satellite radio: satellite_radio.

Any combination may be possible, but in this example it is consideredthat: there are no diesel cars in USA; there are no Model2 in USA orCanada; and that satellite radio is only in USA.

One may then identify the sets using a conventional graph coloringalgorithm, wherein nodes are sets, and wherein links occur if any deviceis a member of the two sets concerned. Slots may then be identified inthe subscription string according to the colors, wherein one slot is foreach color.

For example, graph coloring could give the following groups:

Slot 1—Model1, Model2

Slot 2—diesel, petrol

Slot 3—Europe, NorthAmerica

Slot 4—GB, France, Germany, USA, Canada

Slot 5—satellite_radio, none.

Alternatively, graph coloring could give the following groups:

Slot 1—Model1, Model2

Slot 2—petrol, none

Slot 3—Europe, NorthAmerica

Slot 4—GB, France, Germany, USA, Canada

Slot 5—satellite_radio, diesel, none.

By way of example, one may then consider vehicles having the followingVehicle Identification Numbers (VINs) with associated properties and setidentifiers:

-   -   WVWZZZ1JZWB040695—Model1, Europe, GB, petrol—Prefix:        conv5/model1/petrol/Europe/GB/none    -   WVWZZZ6NZW064342—Model2, Europe, GB, diesel—Prefix:        conv5/model2/none/Europe/GB/diesel    -   WVWAB7AJ9CW201735—Model1, North America, USA, petrol—Prefix:        conv5/model1/petrol/North America/USA/none    -   WVWDB7AJ5EW008921—Model1, North America, USA, petrol, sat        radio—Prefix: conv5/model1/petrol/North America/USA/sat    -   WVWZZZ1KZCW261460—Model1, Europe, GB, diesel—Prefix:        conv5/model1/none/Europe/GB/diesel

With the original topic string format being as follows:“iot-2/type/<type>/id/<myThingId>/evt/<myEvent>/fmt/json”, the followingexample transformations of message topic identifiers from the publisherdevices (undertaken by the proxy for example) may be obtained:

iot-2/type/car/id/WVWZZZ1JZWB040695/evt/engine_info/fmt/json -->conv5/model1/petrol/Europe/GB/none/iot-2/type/car/id/WVWZZZ1JZWB040695/evt/engine_info/fmt/jsoniot-2/type/car/id/WVWZZZ1JZWB040695/evt/location/fmt/json -->conv5/model1/petrol/Europe/GB/none/iot-2/type/car/id/WVWZZZ1JZWB040695/evt/location/fmt/jsoniot-2/type/car/id/WVWDB7AJ5EW008921/evt/engine_info/fmt/json -->conv5/model1/petrol/NorthAmerica/USA/sat/iot-2/type/car/id/WVWDB7AJ5EW008921/evt/engine_info/fmt/jsoniot-2/type/car/id/WVWZZZ1KZCW261460/evt/engine_info/fmt/json -->conv5/model1/none/Europe/GB/diesel/iot-2/type/car/id/WVWZZZ1KZCW261460/evt/engine_info/fmt/jsoniot-2/type/car/id/WVWZZZ6NZXW064342/evt/engine_info/fmt/json -->conv5/model2/none/Europe/GB/diesel/iot-2/type/car/id/WVWZZZ6NZXW064342/evt/engine_info/fmt/jsoniot-2/type/car/id/WVWAB7AJ9CW201735/evt/engine_info/fmt/json -->conv5/model1/petrol/NorthAmerica/USA/none/iot-2/type/car/id/WVWAB7AJ9CW201735/evt/engine_info/fmt/json

Subscriptions of a subscriber application authorized to the set of‘petrol’ vehicles for engine_info may then be transformed by the proxyas follows:

iot-2/type/car/id/+/engine_info/fmt/json -->conv5/+/petrol/+/+/+/iot-2/type/car/id/+/evt/engine_info/fmt/json

As a result, messages received from the broker via the proxy aretransformed (e.g. reverted) by the proxy before they are forwarded tothe subscriber application as follows:

conv5/model1/petrol/Europe/GB/none/iot-2/type/car/id/WVWZZZ1JZWB040695/evt/engine_info/fmt/json -->iot-2/type/car/id/WVWZZZ1JZWB040695/evt/engine_info/fmt/jsonconv5/model1/petrol/NorthAmerica/USA/sat/iot-2/type/car/id/WVWDB7AJ5EW008921/evt/engine_info/fmt/json -->iot-2/type/car/id/WVWDB7AJ5EW008921/evt/engine_info/fmt/jsonconv5/model1/petrol/NorthAmerica/USA/none/iot-2/type/car/id/WVWAB7AJ9CW201735/evt/engine_info/fmt/json -->iot-2/type/car/id/WVWAB7AJ9CW201735/evt/engine_info/fmt/json

Also, subscriptions of a subscriber application authorized to the set of‘GB’ vehicles for all information may be transformed by the proxy asfollows:

iot-2/type/car/id/+/+/fmt/json -->conv5/+/+/+/GB/+/iot-2/type/car/id/+/evt/engine_info/fmt/json

As a result, messages received from the broker via the proxy aretransformed (e.g. reverted) by the proxy before they are forwarded tothe subscriber application as follows:

conv5/model1/petrol/Europe/GB/none/iot-2/type/car/id/WVWZZZ1JZWB040695/evt/engine_info/fmt/json -->iot-2/type/car/id/WVWZZZ1JZWB040695/evt/engine_info/fmt/jsonconv5/model1/petrol/Europe/GB/none/iot-2/type/car/id/WVWZZZ1JZWB040695/evt/location/fmt/json -->iot-2/type/car/id/WVWZZZ1JZWB040695/evt/location/fmt/jsonconv5/model1/none/Europe/GB/diesel/iot-2/type/car/id/WVWZZZ1KZCW261460/evt/engine_info/fmt/json -->iot-2/type/car/id/WVWZZZ1KZCW261460/evt/engine_info/fmt/jsonconv5/model2/none/Europe/GB/diesel/iot-2/type/car/id/WVWZZZ6NZXW064342/evt/engine_info/fmt/json -->iot-2/type/car/id/WVWZZZ6NZXW064342/evt/engine_info/fmt/json

It is to be understood that there could be variations where the topiccomponents are injected in different places.

An embodiment of a method of controlling 100 message delivery frompublisher devices to a subscriber application of a messaging system maybe readily understood with reference to FIG. 3. FIG. 3 is a flow chartof an exemplary implementation of a method according to an embodiment,wherein the steps of the method carried out by a messaging system, suchas the system in FIGS. 1-2, according to a proposed embodiment of thepresent invention are depicted. In this regard, it is noted that thesubscriber may only be permitted to receive messages relating to a topicof subscription from a predetermined set of publisher devices.

First, in step 105, the broker obtains a data structure describing aplurality of different sets of publisher devices and/or the devices orsets that subscriber applications are permitted/authorized to receivemessages from. By way of example, the data structure may be provided tothe broker from an external device and/or a user. Alternatively, and/oradditionally, the broker may generate (at least portions of) the datastructure. The data structure may comprise a list, table, tree or othersuitable representation of sets of publisher devices and/or permissions.These sets may be predefined, e.g. via an external entity or user, orthey may be determined by the broker. By way of example, using the datastructure, the broker may identify a set of publisher devices that thepublisher device belongs to, and/or identify a set of publisher devicesthat a subscriber application is permitted to receive a message from.

Next, in step 110, the subscriber application registers a subscriptionto a topic by generating and communicating a subscription identifierintended for the broker. By way of example, the subscription identifiercomprises a string representing the subscription topic.

The proxy then intercepts the communicated subscription identifier andalters it in step 115. In this example, the proxy receives thesubscription identifier from the subscriber and alters the subscriptionidentifier to create a modified subscription identifier comprising adescription of the topic of the subscription, and the set of publisherdevices that the subscriber application is permitted to receivepublication/messages from. As a result, the proxy a modifiedsubscription identifier.

The modified subscription identifier is then transmitted from the proxyto the broker in step 120, and the broker subsequently receives andstores the modified subscription identifier in step 135.

When a new message is to be published to a topic by a publisher device,the method proceeds to step 130, wherein the publisher generates andcommunicates a message relating to the topic. The message includes (oris associated with) a topic identifier. By way of example, the topicidentifier comprises a string representing the topic of the message.

The proxy then intercepts the communicated message and topic identifierand alters it in step 135. In this example, the proxy receives themessage and topic identifier from the publisher device and alters thetopic identifier to create a modified topic identifier comprising adescription of the topic of the message, and the set of publisherdevices that the publisher device belongs to. As a result, the brokergenerates a modified topic identifier.

The modified topic identifier is then transmitted from the proxy to thebroker in step 140, and the broker subsequently receives the modifiedsubscription identifier in step 145.

Next, in step 150, the broker analyzes the modified topic identifieragainst the modified subscription identifiers it has received fromsubscriber applications (via the proxy) to determine if the publishedmessage is to be communicated to one or more subscriber applications. Byway of example, the broker compares the modified topic identifier(received in step 145) with previously received modified subscriptionidentifier (as in step 125 for example). Thus, the broker determineswhether the message from the publisher device is to be communicated to asubscriber application and, if so, to which subscriber application.

Based on the result of the determination in step 150, the brokertransmits the message towards the appropriate target/intended subscriberapplication in step 155. Of course, if as a result of the determinationstep 150, the broker determines that no subscriber application should besent the message (e.g. because no match between subscription topic andmessage topic is identified), the broker would not transmit any message.However, for the purpose of this example, it is assumed that the brokerdetermines that the message should be communicated to the subscriberapplication and thus transmits the message (along with its modifiedtopic identifier) in step 155.

The proxy then intercepts the transmitted message and modified topicidentifier and alters it in step 160. In this example, the proxyreceives the message and modified topic identifier from the broker andalters the modified topic identifier. More specifically, the proxyremoves the description of the set of devices that the publisher devicebelongs to from the modified topic identifier, thereby forming areverted topic identifier (which is identical to the original topicidentifier of the message published by the publisher device).

The proxy then communicates the published message with the revertedtopic identifier to the subscriber application and it is received by thesubscriber application in step 165.

FIG. 4 is a schematic block diagram of a messaging system 400 accordingto an embodiment of the present subject matter. The messaging system 400comprises publisher devices 410, a message server 420 (adapted toimplement a proxy application and a broker application), and a pluralityof subscriber terminals 430 (adapted to implement subscriberapplications). The publishers 410, message broker server 420, andsubscriber terminals 430 are all connected to a communication network450 (such as the Internet for example).

The subscribers create subscriptions to selected publication topics andregister the subscriptions with the message broker server 420.Permissions information (relating to the what publisher devices 410 thesubscribers are authorized to receive messages/publications from) arealso provided to the message broker server 420, for example by thesubscribers, an input interface to the message broker server, and/orterminals connected to the communication network (such as the publishers410 for example).

The proxy application of the message broker server 420 is adapted to

The message broker server 420 is adapted to generate modified topicidentifiers and modified subscriber identifier which may then be used(e.g. processed or analysed by a broker application) to control thedelivery of published messages to the subscriber application(s). Priorto delivery to a subscriber terminal 430, the modified topic identifiermay be reverted back to its original form.

The proxy application may, for example, intercept messages from apublisher device 410 and undertake modification of the topic identifierbefore communicating the modified topic identifier to the brokerapplication of the message broker server 420. Similarly, the proxyapplication may intercept subscriptions from the subscriber applicationsand undertake modification of the subscription identifiers beforecommunicating the modified subscription identifiers to the brokerapplication of the message broker server 420. The proxy application mayalso then intercept messages from the broker application of the messagebroker server 420 and revert the modified topic identifiers back totheir original form before communicating the message to theintended/target subscriber terminal(s) 430 via the communication network450.

It will be appreciated that the messaging system 400 enables a selectivepublication concept for enabling flexible subscriptions such thatdifferent subscriber applications can use different topic strings tosubscribe to the messages from sets of devices. The proposed conceptsmay be employed in existing messaging system comprising sets ofpublisher devices, a broker (e.g. broker application) and a subscriberapplication.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method, or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in any one or more computer readablemedium(s) having computer usable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CDROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, in abaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Computer code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, radio frequency (RF), etc., or anysuitable combination thereof.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java™, Smalltalk™, C++, or the like, and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer, or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to the illustrativeembodiments of the invention. It will be understood that each block ofthe flowchart illustrations and/or block diagrams, and combinations ofblocks in the flowchart illustrations and/or block diagrams, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable dataprocessing apparatus to produce a machine, such that the instructions,which execute via the processor of the computer or other programmabledata processing apparatus, create means for implementing thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions thatimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus, or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

It will be equally clear to one of skill in the art that all or part ofa logic arrangement according to one embodiment of the present inventionmay suitably be embodied in a logic apparatus comprising logic elementsto perform the steps of the method, and that such logic elements maycomprise components such as logic gates in, for example a programmablelogic array or application-specific integrated circuit. Such a logicarrangement may further be embodied in enabling elements for temporarilyor permanently establishing logic structures in such an array or circuitusing, for example, a virtual hardware descriptor language, which may bestored and transmitted using fixed or transmittable carrier media.

It will be appreciated that the method and arrangement described abovemay also suitably be carried out fully or partially in software runningon one or more processors (not shown in the figures), and that thesoftware may be provided in the form of one or more computer programelements carried on any suitable data-carrier (also not shown in thefigures) such as a magnetic or optical disk or the like. Channels forthe transmission of data may likewise comprise storage media of alldescriptions as well as signal-carrying media, such as wired or wirelesssignal-carrying media.

A method is generally conceived to be a self-consistent sequence ofsteps leading to a desired result. These steps require physicalmanipulations of physical quantities. Usually, though not necessarily,these quantities take the form of electrical or magnetic signals capableof being stored, transferred, combined, compared, and otherwisemanipulated. It is convenient at times, principally for reasons ofcommon usage, to refer to these signals as bits, values, parameters,items, elements, objects, symbols, characters, terms, numbers, or thelike. It should be noted, however, that all of these terms and similarterms are to be associated with the appropriate physical quantities andare merely convenient labels applied to these quantities.

The flowchart and block diagrams in the figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

A data processing system suitable for storing and/or executing programcode will include at least one processor coupled directly or indirectlyto memory elements through a system bus. The memory elements can includelocal memory employed during actual execution of the program code, bulkstorage, and cache memories which provide temporary storage of at leastsome program code in order to reduce the number of times code must beretrieved from bulk storage during execution.

Input/output or I/O devices (including but not limited to keyboards,displays, pointing devices, etc.) can be coupled to the system eitherdirectly or through intervening I/O controllers. Network adapters mayalso be coupled to the system to enable the data processing system tobecome coupled to other data processing systems or remote printers orstorage devices through intervening private or public networks. Modems,cable modems and Ethernet cards are just a few of the currentlyavailable types of network adapters.

The description of the present invention has been presented for purposesof illustration and description, and is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the art. Theembodiment was chosen and described in order to best explain theprinciples of the invention, the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

What is claimed is:
 1. A computer-implemented method of controllingmessage delivery from publisher devices to a subscriber application of amessaging system, the subscriber application having a subscriptionregistered with a message broker of the messaging system and only beingpermitted to receive messages relating to a topic of the subscriptionfrom a predetermined set of one or more publisher devices, the methodcomprising: receiving a message from a publisher device and, based onreceiving the message, altering a topic identifier of the message to amodified topic identifier comprising a description of the topic of themessage and a set of one or more publisher devices that the publisherdevice belongs to, and providing the message with the modified topicidentifier to the message broker; receiving a subscription identifierfrom a subscriber application and, based on receiving the subscriptionidentifier, altering the subscription identifier to a modifiedsubscription identifier comprising a description of the topic of thesubscription and a predetermined set of one or more publisher devicesfrom which the subscriber application is permitted to receive messages,and providing the modified subscription identifier to the messagebroker; analyzing the modified topic identifier and the modifiedsubscription identifier, and determining whether the message is to becommunicated to the subscriber application; and based on determiningthat the message is to be communicated to the subscriber application,removing from the modified topic identifier the description of the setof one or more publisher devices that the publisher device belongs to,wherein the removing forms a reverted topic identifier of the message,and sending the message and reverted topic identifier to the subscriberapplication.
 2. The computer-implemented method of claim 1, wherein theremoving the description of the set of one or more publisher devicesthat the publisher device belongs to from the modified topic identifieris undertaken such that the reverted topic identifier is identical tothe topic identifier of the message from the publisher device.
 3. Thecomputer-implemented method of claim 1, wherein at least one of thealtering the topic identifier or the altering the subscriptionidentifier is undertaken by a proxy application adapted to intercept atleast one of messages or subscription identifiers being communicated toor from the message broker.
 4. The computer-implemented method of claim1, wherein the description of the topic of the subscription comprises astring supporting wildcard entries, and wherein the description of thetopic of the message comprises a string.
 5. The computer-implementedmethod of claim 4, wherein the message broker is a Message QueuingTelemetry Transport, MQTT, broker application.
 6. Thecomputer-implemented method of claim 1, further comprising: obtaining adata structure describing a plurality of different sets of one morepublisher devices; and wherein the altering the topic identifiercomprises analyzing the obtained data structure to identify the set ofone or more publisher devices that the publisher device belongs to. 7.The computer-implemented method of claim 6, wherein the altering thesubscription identifier comprises analyzing the obtained data structureto identify the set of one or more publisher devices that a message ispermitted to be received from.
 8. A computer program product forcontrolling message delivery from publisher devices to a subscriberapplication of a messaging system, the subscriber application having asubscription registered with a message broker of the messaging systemand only being permitted to receive messages relating to a topic of thesubscription from a predetermined set of one or more publisher devices,the computer program product comprising: a non-transitory computerreadable storage medium having program instructions embodied therewith,the program instructions executable by a processing unit to cause theprocessing unit to perform a method comprising: receiving a message froma publisher device and, based on receiving the message, altering a topicidentifier of the message to a modified topic identifier comprising adescription of the topic of the message and a set of one or morepublisher devices that the publisher device belongs to, and providingthe message with the modified topic identifier to the message broker;receiving a subscription identifier from a subscriber application and,based on receiving the subscription identifier, altering thesubscription identifier to a modified subscription identifier comprisinga description of the topic of the subscription and a predetermined setof one or more publisher devices from which the subscriber applicationis permitted to receive messages, and providing the modifiedsubscription identifier to the message broker; analyzing the modifiedtopic identifier and the modified subscription identifier, anddetermining whether the message is to be communicated to the subscriberapplication; and based on determining that the message is to becommunicated to the subscriber application, removing from the modifiedtopic identifier the description of the set of one or more publisherdevices that the publisher device belongs to, wherein the removing formsa reverted topic identifier of the message, and sending the message andreverted topic identifier to the subscriber application.
 9. The computerprogram product of claim 8, wherein the removing the description of theset of one or more publisher devices that the publisher device belongsto from the modified topic identifier is undertaken such that thereverted topic identifier is identical to the topic identifier of themessage from the publisher device.
 10. The computer program product ofclaim 8, wherein at least one of the altering the topic identifier orthe altering the subscription identifier is undertaken by a proxyapplication adapted to intercept at least one of messages orsubscription identifiers being communicated to or from the messagebroker.
 11. The computer program product of claim 8, wherein thedescription of the topic of the subscription comprises a stringsupporting wildcard entries, and wherein the description of the topic ofthe message comprises a string.
 12. The computer program product ofclaim 11, wherein the message broker is a Message Queuing TelemetryTransport, MQTT, broker application.
 13. The computer program product ofclaim 8, further comprising: obtaining a data structure describing aplurality of different sets of one more publisher devices; and whereinthe altering the topic identifier comprises analyzing the obtained datastructure to identify the set of one or more publisher devices that thepublisher device belongs to.
 14. The computer program product of claim13, wherein the altering the subscription identifier comprises analyzingthe obtained data structure to identify the set of one or more publisherdevices that a message is permitted to be received from.
 15. A systemfor controlling message delivery from publisher devices to a subscriberapplication of a messaging system, the subscriber application having asubscription registered with a message broker of the messaging systemand only being permitted to receive messages relating to a topic of thesubscription from a predetermined set of one or more publisher devices,the system comprising: a memory; and a processor communicatively coupledto the memory, wherein the system performs a method comprising:receiving a message from a publisher device and, based on receiving themessage, altering a topic identifier of the message to a modified topicidentifier comprising a description of the topic of the message and aset of one or more publisher devices that the publisher device belongsto, and providing the message with the modified topic identifier to themessage broker; receiving a subscription identifier from a subscriberapplication and, based on receiving the subscription identifier,altering the subscription identifier to a modified subscriptionidentifier comprising a description of the topic of the subscription anda predetermined set of one or more publisher devices from which thesubscriber application is permitted to receive messages, and providingthe modified subscription identifier to the message broker; analyzingthe modified topic identifier and the modified subscription identifier,and determining whether the message is to be communicated to thesubscriber application; and based on determining that the message is tobe communicated to the subscriber application, removing from themodified topic identifier the description of the set of one or morepublisher devices that the publisher device belongs to, wherein theremoving forms a reverted topic identifier of the message, and sendingthe message and reverted topic identifier to the subscriber application.16. The system of claim 15, wherein the removing the description of theset of one or more publisher devices that the publisher device belongsto from the modified topic identifier is undertaken such that thereverted topic identifier is identical to the topic identifier of themessage from the publisher device.
 17. The system of claim 15, whereinat least one of the altering the topic identifier or the altering thesubscription identifier is undertaken by a proxy application adapted tointercept at least one of messages or subscription identifiers beingcommunicated to or from the message broker.
 18. The system of claim 15,wherein the description of the topic of the subscription comprises astring supporting wildcard entries, and wherein the description of thetopic of the message comprises a string.
 19. The system of claim 18,wherein the message broker is a Message Queuing Telemetry Transport,MQTT, broker application.
 20. The system of claim 15, wherein the methodfurther comprises: obtaining a data structure describing a plurality ofdifferent sets of one more publisher devices; and wherein the alteringthe topic identifier comprises analyzing the obtained data structure toidentify the set of one or more publisher devices that the publisherdevice belongs to.